/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
 * Description: watchdog driver
 * Author: huawei
 * Create: 2020-9-27
 */

#ifndef SRC_DRIVERS_DEV_PLAT_WATCHDOG_WATCHDOG_H
#define SRC_DRIVERS_DEV_PLAT_WATCHDOG_WATCHDOG_H

#ifdef STATIC_SKIP
#define STATIC
#else
#define STATIC static
#endif

#define WATCHDOG_LOG_PREFIX "watchdog"
#define dev_watchdog_err(fmt, ...)              \
    do {                                        \
        drv_err(WATCHDOG_LOG_PREFIX, fmt);      \
    } while (0);

#define dev_watchdog_warn(fmt, ...)             \
    do {                                        \
        drv_warn(WATCHDOG_LOG_PREFIX, fmt);     \
    } while (0);

#define dev_watchdog_info(fmt, ...)             \
    do {                                        \
        drv_info(WATCHDOG_LOG_PREFIX, fmt);     \
    } while (0);

#define dev_watchdog_debug(fmt, ...)            \
    do {                                        \
        drv_debug(WATCHDOG_LOG_PREFIX, fmt);    \
    } while (0);

#define WATCHDOG_THRESHOLD          60
#define MILLISECONDS_ONE_SECOND     1000
#define FEED_FREQUENCY              40
#define SIZE_OF_40B                 0x40

#define DISABLE_WATCHDOG_VALUE      0x0
#define EANBLE_WATCHDOG_VALUE       0x1
#define WATCHDOG_MS_1               19200

#define WDOG0_REG_BASE              0x10C200000
#define WATCHDOG_WCS_OFFSET         0x00        // control and status register
#define WATCHDOG_WOR_OFFSET         0x08

#endif